home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / bipl.zip / PROGS.ZIP / ADLFILTR.ICN < prev    next >
Text File  |  1992-09-28  |  1KB  |  55 lines

  1. ############################################################################
  2. #
  3. #    File:     adlfiltr.icn
  4. #
  5. #    Subject:  Program to filter address list entries
  6. #
  7. #    Author:   Ralph E. Griswold
  8. #
  9. #    Date:     September 2, 1991
  10. #
  11. ###########################################################################
  12. #
  13. #    This program filters address lists, allowing through only those entries
  14. #  with specified selectors.
  15. #
  16. #    The options are:
  17. #
  18. #    -s arg    selects entries with characters in args (default is all)
  19. #    -x    inverts the logic, selecting characters not in args
  20. #
  21. ############################################################################
  22. #
  23. #  See also: address.doc, adlcheck.icn, adlcount.icn, adllist.icn,
  24. #     adlsort,icn, labels.icn
  25. #
  26. #  Links: adlutils, options
  27. #
  28. ############################################################################
  29.  
  30. link adlutils, options
  31.  
  32. procedure main(args)
  33.    local selectors, add, opts
  34.  
  35.    opts := options(args,"xs:")
  36.  
  37.    selectors := cset(\opts["s"]) | &cset
  38.  
  39.    if /opts["x"] then {
  40.       while add := nextadd() do
  41.          add.header ? {
  42.             move(1)
  43.             if upto(selectors) then writeadd(add)
  44.             }
  45.       }
  46.    else {
  47.       while add := nextadd() do
  48.          add.header ? {
  49.             move(1)
  50.             if not upto(selectors) then writeadd(add)
  51.             }
  52.       }
  53.  
  54. end
  55.